<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$title=$return['pluginset']['title']?:'抖音客';
set_html('title',$title.'-'.$item['title']);
if($_RQ['op']=='main'){
	$id=intval($_RQ['id']);
	$nowlink=custom_url('jy_douyintui/game//id='.$id,true);
	if($return['pluginset']['ispaohui']==1){
		$num=count($return['pluginset']['paohui_yuming']);
		$num--;
		$index=rand(0,$num);
		$paohui_yuming=$return['pluginset']['paohui_yuming'][$index]['yuming'];
		$nowlink=$paohui_yuming.'/plugin=jy_douyintui&action=game&id='.$id;
	}
	if($_SESSION['container']=='ttapp'){
		$redirect_uri=urlencode($nowlink);
		$scope='video.create,user_info,data.external.item';
		$authurl='https://open.douyin.com/platform/oauth/connect?client_key='.$return['pluginset']['client_key'].'&response_type=code&scope='.$scope.'&redirect_uri='.$redirect_uri;
		exi('','',$authurl);
	}else{
		exi('','',$nowlink);
	}
}